
import React from 'react'
import { connect } from 'dva-no-router'
import { bindActionCreators } from 'redux'

import UI from '../../components/indexPage'

class App extends React.Component{

    componentDidMount() {
        const {queryProjects,getbanben}=this.props;
        queryProjects();
      getbanben();
    }
  render(){

    return(
      <UI {...this.props} />
    )
  }
}

const actions = {
  // queryInSupervision: () => ({type: 'indexPage/queryInSupervision'}),
    queryProjects:() =>({type: 'indexPage/queryProjects'}),
  dialogShow:() =>({type:'indexPage/dialogShow'}),
  getbanben:() =>({type:'indexPage/getbanben'}),
  titleCheck:(val) =>({type:'indexPage/titleCheck',payload:val}),
}

const mapProps = ({indexPage, login}) => ({...indexPage, ...login})

const mapActions = dispatch => ({
  ...bindActionCreators({...actions}, dispatch)
})

export default connect(mapProps, mapActions)(App)